﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorConstraint.h
 * @brief 读写HDF5文件的Constraint类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-06-11
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORCONSTRAINT_H__
#define  _FITKABAQUSHDF5ADAPTORCONSTRAINT_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorBoundaryLocation.h"


 //前置声明
ForwardDeclarNS(Interface, FITKAbaAbstractConstraint)

namespace IO
{
    /**
     * @brief HDF5 Constraint 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-06-11
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorConstraint : public FITKInterfaceHDF5AdaptorBoundaryLocation
    {

    public:
        explicit FITKAbaqusHDF5AdaptorConstraint() = default;
        virtual ~FITKAbaqusHDF5AdaptorConstraint() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-11
         */
        bool adaptW() override;

    protected:

        /**
         * @brief 读取约束
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        virtual bool readConstraint(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 读取Coupling
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool readCoupling(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 读取RigidBody
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool readRigidBody(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 读取Tie
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool readTie(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 写出约束Tie
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        virtual bool writeConstraint(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 写出Coupling
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool writeCoupling(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 写出RigidBody
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool writeRigidBody(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

        /**
         * @brief 写出Tie
         * @param constraint 约束
         * @param h5Group 数据块
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-21
         */
        bool writeTie(Interface::FITKAbaAbstractConstraint* constraint, H5::Group& h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaAbstractConstraint, FITKAbaqusHDF5AdaptorConstraint)

}

#endif
